<!DOCTYPE html>
<html>
<head>
  <title>基础配置 - {$sys_config['site_name']}</title>
  {include file="public/head" /}
</head>
<body class="hold-transition skin-blue sidebar-mini fixed">
<div class="wrapper">

  {include file="public/nav" /}
  {include file="public/menu" /}

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        系统配置
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 控制台</a></li>
        <li class="active">短信配置</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content container-fluid">

      <div class="row" >
        <div class="col-xs-12">
            <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">短信配置</h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form id="configForm" action="{:url('System/saveConfig')}" class="form-horizontal">
              <div class="box-body">

                <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">短信平台：</label>

                  <div class="col-sm-6">
                    <input class="form-control" type="text" name="config[sms_name]" value="{$sms_name|default=''}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">短信通道：</label>

                  <div class="col-sm-6">
                    <textarea class="form-control" rows="3" name="config[sms_posturl]">{$sms_posturl|default=''}</textarea>
                  </div>
                </div>
              </div>
              <!-- /.box-body -->
              <div class="box-footer">
                <div class="col-xs-2"></div>
                <div class="col-xs-2"><button type="button" class="btn btn-primary btn-block" id="configPost">保存更新</button></div>
              </div>
              <!-- /.box-footer -->
            </form>
          </div>
        </div>
      </div>
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  {include file="public/foot" /}
</div>
<!-- ./wrapper -->
{include file="public/js" /}
<script type="text/javascript">

layui.use('layer', function(){
  //保存配置
  $('#configPost').click(function () {
     $.post($('#configForm').attr('action'), $('#configForm').serialize(),function(res){
              if (res.status==1){
                layer.msg(res.msg,{time: 500},function(index, layero){
                  location.reload();
                });
                return false;
              }else{
                layer.msg(res.msg,{time: 500});
                return false;
              }
         }, "json");
  });
});
</script>
</body>
</html>